home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / OwnedFacility.h,v < prev    next >
Text File  |  1989-02-23  |  2KB  |  110 lines

  1. head     3.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.2; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 3.2
  10. date     89.02.20.15.36.28;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.1;
  13.  
  14. 3.1
  15. date     88.12.20.13.50.09;  author grunwald;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     88.10.30.13.05.59;  author grunwald;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @@
  27.  
  28.  
  29. 3.2
  30. log
  31. @Start using Gnu library heaps for schedulers
  32. @
  33. text
  34. @// This may look like C code, but it is really -*- C++ -*-
  35. // 
  36. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  37. //
  38. // written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
  39. //
  40. #ifndef OWNEDFACILITYH
  41. #define OWNEDFACILITYH
  42.  
  43. //
  44. //    OwnedFacility.
  45. //
  46. //    This models a simulation facility. A facility is composed of multiple
  47. //    servers. Servers are utilized for a period of time. The fraction of
  48. //    use of all servers over the total time the facility has existed
  49. //    (or since it was reset) determines the utilization of the facility.
  50. // 
  51.  
  52. #include "Semaphore.h"
  53. #include "Facility.h"
  54.  
  55. class Thread;
  56. class ThreadContainer;
  57.  
  58. typedef Thread *OwnedFacilityKey;
  59.  
  60. class OwnedFacility : public Facility {
  61.  
  62.     struct {
  63.     OwnedFacilityKey single;
  64.     OwnedFacilityKey *many;
  65.     } beingServiced;
  66.  
  67.     virtual void reportErrorState(ostream&);
  68.     void commonReserve(double, OwnedFacilityKey xkey);
  69.  
  70.     public :
  71.  
  72.     OwnedFacility(int servers = 1, ThreadContainer *scheduler =0);
  73.  
  74.     ~OwnedFacility();
  75.  
  76.     virtual void reserve();
  77.     virtual void release();
  78.     virtual bool reserveNoBlock();
  79.  
  80.     virtual void reserveKeyed(OwnedFacilityKey xkey);
  81.     virtual void releaseKeyed(OwnedFacilityKey xkey);
  82.  
  83.     virtual bool isEmpty();
  84.  
  85.     virtual unsigned queueLength();
  86.     virtual unsigned activeServers();
  87.     virtual unsigned size();
  88.  
  89.     virtual void classPrintOn(ostream& s);
  90. };
  91.  
  92. #endif OWNEDFACILITYH
  93. @
  94.  
  95.  
  96. 3.1
  97. log
  98. @Steay version
  99. @
  100. text
  101. @@
  102.  
  103.  
  104. 1.1
  105. log
  106. @Initial revision
  107. @
  108. text
  109. @@
  110.